const app = getApp()
import {parseTime} from '../../common/js/utils'
Page({
  data: {
    title: '',
    id: '',
    form:{},
    htmlData: ''
  },
  onLoad: function (options) {
    let that = this
    that.setData({
      title: options.type + '详情',
      id: options.id
    })
    tt.setNavigationBarTitle({
      title: that.data.title,
    });
  },
  onShow(){
    app.getRequest('/applet/content/detail', 'GET', this.data.id).then(res=>{
      if(res.code==200){
        res.data.content.createTime = parseTime(res.data.content.createTime,'{y}-{m}-{d} {h}:{i}:{s}')
        this.setData({
          form:res.data.content
        })
      }
    })
  },
  methods:{
    getDetails(){
      let that= this
      app.getRequest('/applet/content/detail', 'GET', that.data.id).then(res=>{
        console.log(res);
      })
      
    }
  }
})